package com.license.logic.dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Map;

import com.license.common.util.DbConnection;
import com.license.logic.preference.Activity;

public class SystemOptionDao {
	private Connection connection;
	
	public SystemOptionDao(){
		this.connection = DbConnection.getCon();
	}
	
	public String getProperty( String propertyId){
		String propertyValue;
	        Statement stmt;
	        try {
	            stmt = this.connection.createStatement();
	            ResultSet rs;
	            rs = stmt.executeQuery("Select * from system_option where property =\""+propertyId + "\"");
	            if ( rs.first()){
	            	propertyValue = rs.getString("value");
	            }
	            else {
	            	propertyValue = null;
	            }

	        } catch (SQLException e) {
	            // TODO Auto-generated catch block
	            e.printStackTrace();
	            propertyValue = null;
	        }
	        return propertyValue;
	}
	
}
